package cn.initcap.algorithm.lambda;

import java.util.OptionalInt;
import java.util.stream.DoubleStream;
import java.util.stream.IntStream;
import java.util.stream.Stream;

/**
 * 流基础
 *
 * @author initcap
 * @date Created in 2018/7/29 PM8:01.
 */
public class OptionalTest {

    public static void main(String[] args) {
        OptionalInt max = IntStream.rangeClosed(1, 5).map(i -> i + 1).max();
        System.out.println(max.getAsInt());
        System.out.println(max.hashCode());
        DoubleStream ds = IntStream.rangeClosed(1, 10).asDoubleStream();
        ds.forEach(System.out::println);
        Stream<Integer> is = IntStream.rangeClosed(1, 10).boxed();
        is.forEach(System.out::println);
    }
}
